import request from '@/utils/request'
import type { loginForm, respLoginData } from './types'

enum API {
  LOGIN_URL = '/user/login',
  REFRESH_URL = '/refresh_token',
  USER_URL = '/user',
  MULTI_URL = '/testmulti',
  QUSER_URL = '/user/quser',
}

export const reqLogin = (data: loginForm) =>
  request.post<any, respLoginData>(API.LOGIN_URL, data)
export const reqUserInfo = () => request.get(API.USER_URL)

export const reqMulti = () => request.get(API.MULTI_URL)

export const reqRegister = (data: any) => {
  return request.post(API.USER_URL, data)
}
export const reqUserupdate = (data) => {
  return request.put(API.USER_URL, data)
}

export const reqQUserInfo = (data) => request.post(API.QUSER_URL, data)
